<div class="row mb-s" if-permission="manageShare" allowed="{{userPermissions}}">
    <div class="col-md-12">
        <div class="btn-toolbar" role="toolbar">
            <div class="btn-group">
                <button class="btn btn-sm btn-primary" ng-click="$vm.shareCase()" ng-disabled="!$vm.enableAddButton">
                    <i class="fa fa-plus"></i>
                    Add share
                </button>
            </div>
        </div>
    </div>
</div>

<div class="row" ng-if="$vm.shares.length === 0">
    <div class="col-md-12">
        <div class=" empty-message">No records</div>
    </div>
</div>

<div class="row" ng-if="$vm.shares.length > 0">
    <div class="col-md-12">
        <p>
            The current case is shared with the following organisation(s)
        </p>

        <sharing-list
            shares="$vm.shares"
            organisations="$vm.organisations"
            profiles="$vm.profiles"
            on-delete="$vm.removeShare(share)"
            on-update-profile="$vm.updateShareProfile(org, profile)"
            permissions="userPermissions"
            ></sharing-list>
    </div>
</div>
